﻿/*
 *  RacerLib - XNA Racing Game Level and Tile Management Library
 * 
 *  Copyright (C) 2009 Sebastian Schäfer
 *  
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *  
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License 
 *  along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
using System;
using System.Collections.Generic;

namespace gdv.VCPR.Racer
{
    /// <summary>
    /// An Interface for a simple TrackServer to exchange tracks
    /// </summary>
    public interface ITrackServer
    {
        /// <summary>
        /// A dictionary containing all present tracks
        /// </summary>
        /// <returns>[...]</returns>
        Dictionary<int, TrackInfo> GetTrackInfos();

        /// <summary>
        /// Retrieve a single track based on the index stored in the dictionary
        /// </summary>
        /// <param name="idx">track index</param>
        /// <returns>[...]</returns>
        Track GetTrack(int idx);

        /// <summary>
        /// Add a track to server instance - no storing
        /// </summary>
        /// <param name="track">the track</param>
        /// <returns>the index of the added track</returns>
        int AddTrack(Track track);

        /// <summary>
        /// Store a track on the server.
        /// </summary>
        /// <param name="track">track</param>
        /// <param name="fname">base filename</param>
        /// <returns>success</returns>
        bool StoreTrack(Track track, String fname);
    }
}
